<template>
	<view>
		<view class="flexcenter" v-if="!list.data.length">
			<view class="placeholderimage" style="margin-top: 100rpx;" ></view>
		</view>
		<view class="ffffff mainpadding_top radius" v-for="item in list.data" :key="item.id">
			<view class="xiahuax">
				<view class="flexbetween">
					<view class="ershib1">續訂<text class="huang_text bold">{{item.day}}</text>天</view>
					<view class="huang_text" v-show="item.status==0">待審核</view>
					<view class="lv_text" v-show="item.status==1">已通過</view>
					<view class="hong_text" v-show="item.status==2">已拒絕</view>
				</view>
				<view class="flexleft margin_top2">
					<view class=" hei_text">支付方式：</view>
					<view class="hei_text main_size bold" v-if="item.type==1">點數支付
					</view>
					<view class="hei_text main_size bold" v-if="item.type==2">多元支付</view>
					<view class="hei_text main_size bold" v-if="item.type==3">現金支付</view>
					<view class="hei_text main_size bold" v-if="item.type==4">信用卡</view>
					<view class="hei_text main_size bold" v-if="item.type==5">Line Pay線上支付
					</view>
					<view class="hei_text main_size bold" v-if="item.type==6">街口線上支付
					</view>
					<view class="hei_text main_size bold" v-if="item.type==7">街口線下支付
					</view>
					<view class="hei_text main_size bold" v-if="item.type==8">Line Pay線下支付
					</view>
					<view class="hei_text main_size bold" v-show="item.type==9">Line Pay二維碼支付
					</view>
					<view class="hei_text main_size bold" v-show="item.type==10">街口二維碼支付
					</view>
					<view class="hei_text main_size bold" v-show="item.type==11">全支付線下支付
					</view>
				</view>
				
				<view class="margin_top2 flexbetween">
					<view class="qhtext">{{item.createtime_text}}</view>
					<view class="qianshu">{{item.money}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) { //积分明細列表
				let _this = this;
				httpRequest.request('/api/shop/BuyuserinvoiceIndex', 'GET', {
					page: page || 1,
					limit: _this.limit,
					shop_id:uni.getStorageSync("shop_id")
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data.data;
						if (isPage == true) {
							_this.list.data = _this.list.data.concat(resList);
						} else {
							_this.list = res.data;
							_this.list.data = resList;
						}
					}
				})
			},
			// 
			onReachBottom() { //页面触底加载，上拉加载
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>
.qianshu {
		font-size: 32rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #FFB800;
	}
</style>
